<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.w3.org/1999/xhtml"
      layout:decorator="/layouts/default">
<th:block layout:fragment="title">
    数据库列表
</th:block>
<!-- head -->
<th:block layout:fragment="head">
    <!--页面自定义样式-->
    <style>
        /** style */
    </style>
</th:block>
<!-- content -->
<th:block layout:fragment="content">



            <el-row class="fn-clear">
                <el-col class="fn-tal" :span="18">
                    <el-button @click="submitColForm('columnForm')" type="warning" plain>保存</el-button>
                    <el-button :disabled="columnForm.id == null || columnForm.id == ''" @click="download" type="primary" plain>生成代码</el-button>
                </el-col>
            </el-row>

            <el-form :model="columnForm" label-position="right"  label-width="100px">
                <el-row>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="前缀：">
                            <el-input v-model="columnForm.prefix" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="包名">
                            <el-input v-model="columnForm.modelName" >
                                <template slot="prepend">com.</template>
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="author：">
                            <el-input v-model="columnForm.author" ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="entityName：">
                            <el-input v-model="columnForm.entityName" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="mapperName">
                            <el-input v-model="columnForm.mapperName" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="xmlName：">
                            <el-input v-model="columnForm.xmlName" ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="serviceName：">
                            <el-input v-model="columnForm.serviceName" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="serviceImplName">
                            <el-input v-model="columnForm.serviceImplName" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="controllerName：">
                            <el-input v-model="columnForm.controllerName" ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="entityPackage：">
                            <el-input v-model="columnForm.entityPackage" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="servicePackage">
                            <el-input v-model="columnForm.servicePackage" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="serviceImplPackage：">
                            <el-input v-model="columnForm.serviceImplPackage" ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="mapperPackage：">
                            <el-input v-model="columnForm.mapperPackage" ></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" class="fn-pr20">
                        <el-form-item class="fn-ml30" label="controllerPackage：">
                            <el-input v-model="columnForm.controllerPackage" ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-table stripe="true" fixed class="fn-mt10" :data="data_group.list" highlight-current-row
                          @selection-change="onSelectionChange">
                    <el-table-column type="index" width="50"></el-table-column>
                    <el-table-column prop="colName" label="列名" align="center" min-width="5%"
                                     show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column prop="colType" label="类型" align="center" min-width="15%"
                                     show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column prop="comments" label="注释" align="center" min-width="15%"
                                     show-overflow-tooltip="true">
                        <template scope="scope">
                            <el-input v-model="scope.row.comments" placeholder="请填写注释"
                                      :rules="{required: true, message: '注释不能为空', trigger: 'blur'}"></el-input>
                        </template>
                    </el-table-column>
                    <el-table-column prop="extra" label="主键" align="center" min-width="15%"
                                     show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="nullable" label="是否允许为Null" align="center" min-width="15%" show-overflow-tooltip="true">
                        <template scope="scope">
                            {{scope.row.nullable?'':'NOT NULL'}}
                        </template>
                    </el-table-column>
                    <el-table-column prop="defaultValue" label="默认值" align="center" min-width="15%"
                                     show-overflow-tooltip="true"></el-table-column>
                </el-table>
            </el-form>



</th:block>

<!-- js -->
<th:block layout:fragment="js">
    <!--页面js-->
    <script th:src="@{/js/code/column.js}"></script>


</th:block>
</html>
